package com.softserveinc.interactive_board.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.softserveinc.interactive_board.dao.PresentationDAO;
import com.softserveinc.interactive_board.domain.Presentation;
import com.softserveinc.interactive_board.domain.PresentationStatus;

@Service
public class PresentationServiceImpl implements PresentationService {
	
	@Transactional
	public boolean addPresentation(Presentation presentation) {
		return this.presentationDAO.addPresentation(presentation);
	}

	@Transactional
	public List<PresentationStatus> getPresentationStatuses() {
		return this.presentationDAO.getPresentationStatuses();
	}

	@Transactional
	public List<Presentation> getPresentatios() {
		return this.presentationDAO.getPresentations();
	}

	@Transactional
	public List<Presentation> getPresentationsByStatusId(int id) {
		return this.presentationDAO.getPresentationsByStatusId(id);
	}
	
	@Transactional
	public List<Presentation> getPresentationsByPresentorId(int id) {
		return this.presentationDAO.getPresentationsByPresentorId(id);
	}

	@Transactional
	public Presentation getPresentation(Presentation pres) {
		return this.presentationDAO.getPresentation(pres);
	}

	@Transactional
	public boolean updatePresentation(Presentation pres){
		return this.presentationDAO.updatePresentation(pres);
	}
	
	@Transactional
	public void deletePresentation(Presentation presentation) {
		this.presentationDAO.deletePresentation(presentation);
	}
	
	@Transactional
	public void deletePresentation(Long presId) {
		this.presentationDAO.deletePresentation(presId);
	}

	@Transactional
	public void deletePresentations(List<Presentation> list) {
		this.presentationDAO.deletePresentations(list);
	}
	
	protected PresentationDAO presentationDAO;

	@Autowired
	@Qualifier("presentationDAOImpl")
	public void setPresentationDAO(PresentationDAO presentationDAO) {
		this.presentationDAO = presentationDAO;
	}

}
